package com.jmu.posms.common;

import lombok.Data;

@Data
public class Result {
    private String code;
    private String msg;
    private Object data;

    public Result(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static Result success(Object o){
        return new Result("200","",o);
    }

    public static Result success(Object o,String msg){
        return new Result("200",msg,o);
    }

    public static Result error(String msg){
        return new Result("400",msg,null);
    }

    public static Result error(String code,String msg){
        return new Result(code,msg,null);
    }
}
